<template>
	<div>
		<u-navbar :border-bottom="false" title="店铺入驻"></u-navbar>
		<view class="flex align-center justify-center fs-28 pt-4 fte87722" v-if="auditText">{{auditText}}</view>
		<step1 :companyData="companyData" :status="status" @callback="next()" />
	</div>
</template>

<script>
	import {
		merchantManageauditStatus,
		merchantManageinfo
	} from "@/api/entry";
	import step1 from "./step1";
	export default {
		data() {
			return {
				companyData: {},
				current: 1,
				auditText: '',
				status: null
			};
		},
		components: {
			step1
		},
		mounted() {
			this.merchantManageauditStatus()
			this.merchantManageinfo()
		},
		methods: {
			merchantManageauditStatus() {
				merchantManageauditStatus().then(res => {
					const data = res.data.data
					if (data) {
						this.status = data.audit_status
						if (data.audit_status === 0) {
							this.auditText = '您的商户资质正在审核中，请耐心等待审核结果。'
						}
						if (data.audit_status === 2) {
							this.auditText = '您的商户资质审核被拒绝，请联系客服。'
						}
					}

				})
			},
			merchantManageinfo() {
				merchantManageinfo().then(res => {
					if (res.data.data) {
						this.companyData = res.data.data.merchant
					}

				})
			},
			next() {
				this.merchantManageauditStatus()
				this.merchantManageinfo()
			},
			finished() {
				uni.navigateTo({
					url: "/pages/passport/entry/seller/index",
				});
			},
		},
	};
</script>

<style lang="scss" scoped></style>